package com.tsc.springTemp.springBeanLifeModel;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: chentl
 * @Date: 2025/09/12/12:18
 * @Description:
 */
public class BeanLifecycleDemo {
    public static void main(String[] args) {
        // 创建容器
        MyApplicationContext context = new MyApplicationContext();

        // 获取 Bean（触发创建和初始化）
        UserService userService = (UserService) context.getBean("userService");

        // 使用 Bean
        userService.sayHello();

        // 关闭容器（触发销毁）
        context.close();
    }
}
